home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Applications / Nuntius 1.2 / src / Nuntius / Tools.h < prev    next >
Encoding:
Text File  |  1994-02-20  |  1.8 KB  |  53 lines  |  [TEXT/MPS ]

  1. // Copyright © 1992 Peter Speck, speck@dat.ruc.dk. All rights reserved.
  2. // Tools.h
  3.  
  4. #define __TOOLS__
  5.  
  6. void InitUTools();
  7.  
  8. void MyGetIndString(CStr255 &s, short id);
  9.  
  10. // returns index
  11. short SubstituteOneStringItem(CStr255 &string, const char *marker, const CStr255 &substString);
  12. short SubstituteStringItems(CStr255 &string, const CStr255 &marker, const CStr255 &substString);
  13. short SubstituteStringItems(CStr255 &string, const char *marker, const CStr255 &substString);
  14. short SubstituteStringItems(CStr255 &string, const char *marker, const char *substString);
  15. short SubstituteStringItems(CStr255 &string, const char *marker, short number);
  16. short SubstituteStringItems(CStr255 &string, const char *marker, long number);
  17.  
  18. void VersionToString(long version, CStr255 &text);
  19.  
  20. void AppendStringToHandle(const CStr255 &text, Handle h);
  21. void AppendStringToHandle(const char *p, Handle h);
  22. void CopyCString2String(const CStr255 &src, StringPtr dest);
  23.  
  24. Boolean CStr255HasChar(const CStr255 &s, char ch);
  25. short CStr255CharPos(const CStr255 &s, char ch);
  26. short CStr255CharPos(const CStr255 &s, char ch, short maxPos);
  27. short CStr255CharPosBackwards(const CStr255 &s, char ch, short startPos);
  28. short StrCmp(const CStr255 &item1, const CStr255 &item2); // see UList.h for return value
  29. Boolean StrEqual(const CStr255 &item1, const CStr255 &item2);
  30.  
  31. void Long2Hex(long l, CStr255 &s);
  32. const char *OSType2String(OSType ot);
  33.  
  34. void CopyDynamicArray(TDynamicArray *from, TDynamicArray *to);
  35.  
  36. #if qDebug
  37. void BytesMove(const void *src, void *dest, long size);// handles >32K
  38. #else
  39. inline void BytesMove(const void *src, void *dest, long size)
  40. {
  41.     memcpy(dest, src, (unsigned int)size);
  42. }
  43. #endif
  44.  
  45. #if qDebug
  46. void MyBlockMove(const void *src, void *dest, long size);// handles >32K
  47. #else
  48. inline void MyBlockMove(const void *src, void *dest, long size)
  49. {
  50.     memmove(dest, src, (unsigned int)size);
  51. }
  52. #endif
  53.